package org.wattdepot.cli;

import org.wattdepot.client.WattDepotClientException;
import java.util.Scanner;

/**
 * A simple command line interface to WattDepot that shows basic connection and processing.
 * 
 * @author Philip Johnson
 */
public class CommandLineInterface {

  /**
   * The main program that is invoked from 'java -jar wattdepot-cli.jar'.
   * 
   * @param args All args are ignored.
   * @throws WattDepotClientException If anything goes wrong.
   */
  public static void main(String[] args) throws WattDepotClientException {
    System.out.println("Starting CLI.");
    ExtractionInterface test = new DataExtraction();
    System.out.println(test.getSourcesInfo());
    Scanner input = new Scanner(System.in); 
    String inputText;
    System.out.println("Please type a command after the >. " +
      "\nType help for commands, if necessary.");
    while (true) {
      System.out.print("> ");
      inputText = input.nextLine();
      StringInterface argument = new StringExtraction(inputText);
      //System.out.println(argument);
      Command.obtainData(test, argument);
    }
  }
}

